<link rel="stylesheet" href="__STATIC__mobile/css/orderlist.css">
<style>
.layermbox0 .layermchild {
    max-width: 400px;
    min-width: 90%;
}

*{
	-webkit-appearance: none;
}

.reward_access {
    display: inline-block;
    padding: 0 1.6em;
    line-height: 2;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    background-color: #dc5d4a;
    color: #fff;
    font-size: 16px;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}
</style>

<div class="membersbox">

<!--  pad50
	<div class="morder-search">
		<form action="">
			<div class="morder-search-wrapper clearfix">
				<div class="morder-search-input fl">
					<input type="text" name="order_no" value="" placeholder="输入订单号"
						id="">
				</div>
				<div class="morder-search-btn fr">
					<input type="submit" value="搜索">
				</div>
			</div>

		</form>
	</div>
-->
	<section class="morder_nav g-box" style="top:0px;">
		<section class="<?php echo (get('status')==1)?'cur':''; ?>">
			<a href="/mobile/guestbook/customer?status=1">待跟进(<?php echo $customer_nums[1];?>)</a><i></i>
		</section>
		<section class="<?php echo (get('status')==2)?'cur':''; ?>">
			<a href="/mobile/guestbook/customer?status=2">已跟进(<?php echo $customer_nums[2];?>)</a><i></i>
		</section>
		<section class="<?php echo (get('status')==3)?'cur':''; ?>">
			<a href="/mobile/guestbook/customer?status=3">已完结<?php echo $customer_nums[0];?></a><i></i>
		</section>
		
	</section>

	<section class="sectionPanel" style="padding-top: 50px;">
		<section class="morder_con" style="display: block;">
			<div id="j-all">
			
			<?php if(empty($datalist)){ ?>
			<div id="j-delivered">
				<div style="padding: 50px 0 0; text-align: center; border: 0;">
					<img src="__STATIC__mobile/images/whitenorder.png" width="30%" alt="">
					<p style="padding: 10px; font-size: 16px; color: #666">暂无信息,请继续努力</p>
				</div>
			</div>
			<?php } ?>
			
				<?php foreach($datalist as $k=>$v){?>
				<section class="order-list-info clearfix">
					<a href="javascript:void(0);"> 
					<span class="fl">
							<p>客户编号：<?php echo $v['uid'];?>　　信息编号：<?php echo $v['guestbook_id'];?></p>
							<p>日期：<?php echo $v['create_time'];?></p>
					</span> 
					<span class="fr colorFF8F09 lh18"> 
					
					<?php if($v['is_reply'] == 1){ ?><span style="color:#25c401">已跟进</span><?php }else if($v['is_reply'] == 0){ ?>
					<span style="color:#ff0000">待跟进</span><?php }else if($v['is_reply'] == 2){ ?>
					<span style="color:#7e6b5a">已完结</span><?php } ?>
					</span>
					</a>
				</section>
				<section class="morder_goods">
					<ul>
						<li class="g-box">
							<section class="morder_goods_img">
								<a href="javascript:void(0);">
								 <img src="<?php echo $v['headimgurl'];?>" width="80" height="80"
									onerror="javascript:this.src='http://fxmall.b0.upaiyun.com/upload/goods/2016-01/09/241341452278914.jpg!headimgurl';">
								</a> <span> </span>
							</section>
							<section class="morder_goods_infor g-flex">
								<a href="javascript:void(0);" style="margin-top: 30px;"></a>
								<p></p>
							</section>
							<section class="morder_goods_rmb">
								<p><?php echo $v['hetong_money'] ? $v['hetong_money'] : '';?></p>
								<span><?php echo $v['chengjiao_status'] ? "已成交" : '待成交';?></span>
							</section>
						</li>
					</ul>
				</section>
				
				<section class="morder_goods">
					<ul>
					
						<li class="g-box">
							<section style="padding:0 10px;">
文章：<?php echo $v['article_title'];?>
							</section>
						</li>
						<li class="g-box">
							<section style="padding:0 10px;">
客户留言: <b><?php echo $v['content'];?></b>
							</section>
						</li>
						<li class="g-box">
							<section style="padding:0 10px;">
姓名：<b><?php echo $v['realname'];?></b>　　　手机号码：<b><?php echo $v['mobile'];?></b>
							</section>
						</li>
						<li class="g-box">
							<section style="padding:0 10px;">
手机归属地：<b><?php echo $v['mobile_location'];?></b>　　　手机型号: <b><?php echo $v['mobile_com'];?> <?php echo $v['mobile_brand'];?></b>
							</section>
						</li>
						
						<li class="g-box">
							<section style="padding:0 10px;">
网络归属地：<b><?php echo $v['ip_location'];?></b>　　　网络：<b><?php echo $v['network'];?></b>
							</section>
						</li>
		
<?php if($v['zhongjie_uid']){ ?>
						
						<li class="g-box">
							<section style="padding:0 10px;">
金牌推手：<b><?php echo $v['zhongjie_nickname'];?></b>  (手机: <a style="color:#000;" href="tel://<?php echo $v['zhongjie_mobile'];?>" ><?php echo $v['zhongjie_mobile'];?></a>)
							</section>
						</li>	
<?php } ?>						
						
						
						<li class="g-box">
							<section style="padding:0 10px;">
合同编号：<?php echo $v['hetong_sn'] ? $v['hetong_sn'] : '暂未签订';?>
							</section>
						</li>	
						
						
						
<?php foreach($v['genjin'] as $kk=>$vv){ ?>
						<li class="g-box">
							<section style="padding:0 10px;">
<?php echo $vv['create_time'];?> <?php echo $vv['content'];?> <?php if($memberinfo['uid']!=$vv['uid']){?>(金牌推手备注)<?php } ?>
							</section>
						</li>	
<?php } ?>
						
						
							
					</ul>
				</section>
				
				
				
				<section class="morder_pay">
					<p>
					
					</p>
					<p>
							<a href="javascript:note('<?php echo $v['guestbook_id'];?>');" class="J_pay">备注</a>
						
							<a href="tel://<?php echo $v['mobile'];?>" class="J_pay">拨打电话</a> 
						
							<?php if($v['is_reply'] == 1){ ?>
							<a href="javascript:daigenjin('<?php echo $v['guestbook_id'];?>');" class="J_pay">待跟进</a>
							<a href="javascript:wanjie('<?php echo $v['guestbook_id'];?>');" class="J_del">完结</a>
							<?php } ?>
							
							<?php if($v['is_reply'] == 0){ ?>
							 <a href="javascript:yigenjin('<?php echo $v['guestbook_id'];?>');" class="J_pay">已跟进</a>
							<?php } ?>
							
							<?php if($v['is_reply'] == 2){ ?>
							 <a href="javascript:daigenjin('<?php echo $v['guestbook_id'];?>');" class="J_pay">待跟进</a>
							<?php } ?>
						
					</p>
				</section>
				
				<?php } ?>
			</div>
			

		</section>
		<include file="Common:bottom" />
</div>

<include file="Common:nav" />

<script>

function note(id){
	
	var html ='<form id="bbbb" action="/mobile/guestbook/noteajax">'+
	'<input type="hidden"  value="'+id+'"  name="guestbook_id">'+
	'<textarea id="beizhu" name="content" style="width:98%;min-height:100px;border:1px solid #999;"></textarea></form>'+
	
	'<p style="text-align:center;"><a class="reward_access" href="javascript:editnote('+id+');" style="color: #fff;">保存</a></p>';

	
    layer.open({
    	title:"请输入备注",
        content: html,
    });
}

function editnote(id){
	AjaxFormSubmit('bbbb');
}


/*
 * 退款
 */
function wanjie(id){
    layer.open({
        content: "亲,你确定将此信息标记为完结吗?<br><span style='font-size:small;'>提示:可将已完成服务或无合作意向的客户标记为完结</span>",
        btn: ['确定', '取消'],
        yes: function(index){
        
        	AjaxUrl('/mobile/guestbook/genjin?is_reply=2&gid='+id);
            layer.close(index);
        }
    });
}

 function daigenjin(id){
		
	    layer.open({
	        content: "亲,你确定要将此信息重新放入待跟进吗?",
	        btn: ['确定', '取消'],
	        yes: function(index){
	        	AjaxUrl('/mobile/guestbook/genjin?is_reply=0&gid='+id);
	            layer.close(index);
	        }
	    });
}
 
 function yigenjin(id){
		
    layer.open({
        content: "亲,你已经跟进了此信息吗?",
        btn: ['已跟进', '还没有'],
        yes: function(index){
        	AjaxUrl('/mobile/guestbook/genjin?is_reply=1&gid='+id);
            layer.close(index);
        }
    });
}
 
 
</script>

